package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.vo.SysQuarterlyHeaderVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysQuarterlyHeaderMapper;
import com.ruoyi.system.domain.SysQuarterlyHeader;
import com.ruoyi.system.service.ISysQuarterlyHeaderService;

/**
 * 季刊头Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-03-29
 */
@Service
public class SysQuarterlyHeaderServiceImpl implements ISysQuarterlyHeaderService 
{
    @Autowired
    private SysQuarterlyHeaderMapper sysQuarterlyHeaderMapper;

    /**
     * 查询季刊头
     * 
     * @param headerId 季刊头主键
     * @return 季刊头
     */
    @Override
    public SysQuarterlyHeader selectSysQuarterlyHeaderByHeaderId(Long headerId)
    {
        return sysQuarterlyHeaderMapper.selectSysQuarterlyHeaderByHeaderId(headerId);
    }

    /**
     * 查询季刊头列表
     * 
     * @param sysQuarterlyHeader 季刊头
     * @return 季刊头
     */
    @Override
    public List<SysQuarterlyHeader> selectSysQuarterlyHeaderList(SysQuarterlyHeader sysQuarterlyHeader)
    {
        return sysQuarterlyHeaderMapper.selectSysQuarterlyHeaderList(sysQuarterlyHeader);
    }

    /**
     * 新增季刊头
     * 
     * @param sysQuarterlyHeader 季刊头
     * @return 结果
     */
    @Override
    public int insertSysQuarterlyHeader(SysQuarterlyHeader sysQuarterlyHeader)
    {
        sysQuarterlyHeader.setCreateTime(DateUtils.getNowDate());
        return sysQuarterlyHeaderMapper.insertSysQuarterlyHeader(sysQuarterlyHeader);
    }

    /**
     * 修改季刊头
     * 
     * @param sysQuarterlyHeader 季刊头
     * @return 结果
     */
    @Override
    public int updateSysQuarterlyHeader(SysQuarterlyHeader sysQuarterlyHeader)
    {
        sysQuarterlyHeader.setUpdateTime(DateUtils.getNowDate());
        return sysQuarterlyHeaderMapper.updateSysQuarterlyHeader(sysQuarterlyHeader);
    }

    /**
     * 批量删除季刊头
     * 
     * @param headerIds 需要删除的季刊头主键
     * @return 结果
     */
    @Override
    public int deleteSysQuarterlyHeaderByHeaderIds(Long[] headerIds)
    {
        return sysQuarterlyHeaderMapper.deleteSysQuarterlyHeaderByHeaderIds(headerIds);
    }

    /**
     * 删除季刊头信息
     * 
     * @param headerId 季刊头主键
     * @return 结果
     */
    @Override
    public int deleteSysQuarterlyHeaderByHeaderId(Long headerId)
    {
        return sysQuarterlyHeaderMapper.deleteSysQuarterlyHeaderByHeaderId(headerId);
    }

    @Override
    public List<SysQuarterlyHeaderVo> selectSysQuarterlyDetails(SysQuarterlyHeader sysQuarterlyHeader) {

        return sysQuarterlyHeaderMapper.selectSysQuarterlyDetails(sysQuarterlyHeader);
    }
}
